home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Games #12
/
GEGA012.iso
/
Jogos de Azar
/
fruit.swf
/
scripts
/
frame_1
/
DoAction.as
Wrap
Text File
|
2006-01-17
|
69KB
|
2,680 lines
if(include_Library_Complete != true)
{
var include_Library_Complete = true;
var hello = "created 3wgraphics design studio. www.3wgraphics.net 1999-2002";
delete hello;
Object.prototype.toXML = function(name, num)
{
if(name == null)
{
name = typeof this;
}
if(num == null)
{
num = 1;
_root.array_for_delete_numbers = [];
}
var proto = this.__proto__;
this.__proto__ = undefined;
var attr = " id=\"" + num + ".0" + "\"";
this.number_for_trace_objects = num;
_root.array_for_delete_numbers.push(this);
if(name == "movieclip")
{
attr += " name=\"" + this._name + "\"";
}
var XML_result = new XML("<" + name + attr + "><tmp /></" + name + ">");
var type;
var element;
var marks;
for(var v in this)
{
if(!(v == "__proto__" || v == "number_for_trace_objects" || v == "array_for_delete_numbers"))
{
type = typeof this[v];
if(type == "object" || type == "movieclip")
{
if(!this[v].number_for_trace_objects)
{
if(this[v].__proto__ == Array.prototype)
{
type = "Array";
}
else if(isXML(this[v]))
{
type = "XML";
}
else if(this[v].__proto__ == XMLSocket.prototype)
{
type = "XMLSocket";
}
else if(this[v].__proto__ == Sound.prototype)
{
type = "Sound";
}
element = new XML("<" + v + " />");
if(type == "XML")
{
element.firstChild.appendChild(this[v].firstChild.cloneNode(true));
}
else
{
element.firstChild.appendChild(this[v].toXML(type,++num).firstChild);
}
}
else
{
this[v].number_for_trace_objects += 0.01;
attr = " id=\"" + this[v].number_for_trace_objects + "\"";
if(type == "movieclip")
{
attr += " name=\"" + this[v]._name + "\"";
}
element = new XML("<" + v + attr + " />");
}
}
else
{
marks = type != "string" ? "" : "\"";
if(type == "number" || type == "string" || type == "boolean")
{
attr = "";
}
else
{
attr = " type=\"" + type + "\"";
}
element = new XML("<" + v + (type != "function" ? "" : " type=\"function\"") + ">" + " " + marks + this[v] + marks + " " + "</" + v + ">");
if(element.firstChild.firstChild.nodeType == 3 && element.firstChild.firstChild.nodeValue == " ")
{
element.firstChild.firstChild.removeNode();
}
}
XML_result.firstChild.insertBefore(element.firstChild,XML_result.firstChild.firstChild);
}
}
XML_result.firstChild.lastChild.removeNode();
if(XML_result.firstChild.attributes.id == "1.0")
{
var i = 0;
while(i < _root.array_for_delete_numbers.length)
{
delete _root.array_for_delete_numbers[i].number_for_trace_objects;
i++;
}
delete _root.array_for_delete_numbers;
}
this.__proto__ = proto;
return XML_result;
};
Object.prototype.toString = function()
{
return this.toXML("Object").toString2();
};
Object.prototype.trace = function()
{
trace(this.toXML().toString2());
};
Function.prototype.toString = function()
{
return "function";
};
XMLNode.prototype.toString1 = XMLNode.prototype.toString;
XMLNode.prototype.toString = function()
{
if(this.tabDesign)
{
return this.toString2();
}
return this.toString1();
};
XMLNode.prototype.toString2 = function(tab)
{
var traced_value = "";
if(this.nodeType != 3)
{
if(this.nodeName != null)
{
traced_value = "<" + this.nodeName;
for(var v in this.attributes)
{
traced_value += " " + v + "=\"" + this.attributes[v] + "\"";
}
if(this.firstChild == null)
{
traced_value += " />";
}
else if(this.firstChild.nodeType == 3 && this.firstChild == this.lastChild)
{
traced_value += ">" + this.firstChild.toString2() + "</" + this.nodeName + ">";
}
else
{
traced_value += ">\r " + tab + this.firstChild.toString2(tab + " ") + "\r" + tab + "</" + this.nodeName + ">";
}
}
else
{
traced_value = this.firstChild.toString2("");
}
}
else
{
traced_value = this.nodeValue;
}
if(this.nextSibling != null)
{
traced_value += "\r" + tab + this.nextSibling.toString2(tab);
}
return traced_value;
};
ASSetPropFlags(Object.prototype,"toXML,trace",131);
ASSetPropFlags(XMLNode.prototype,"toString1,toString2,tabDesign",131);
var o = Object.prototype;
o["set"] = function(param, value)
{
this[param] = value;
};
o.clone = function()
{
var o = new this.constructor();
o.__proto__ = this.__proto__;
return o.copy(this);
};
o.copy = function(o)
{
var proto = o.__proto__;
o.__proto__ = undefined;
for(var v in o)
{
this[v] = o[v];
}
o.__proto__ = proto;
return this;
};
o.clear = function()
{
var proto = this.__proto__;
this.__proto__ = undefined;
for(var v in this)
{
delete this[v];
}
this.__proto__ = proto;
this.constructor.apply(this,arguments);
};
o.applyClass = function(c)
{
if(typeof c != "function")
{
return false;
}
this.__proto__ = c.prototype;
c.apply(this,arguments.slice(1));
return true;
};
o.paramHide = function(paramsArray)
{
ASSetPropFlags(this,paramsArray || null,1);
};
o.paramShow = function(paramsArray)
{
ASSetPropFlags(this,paramsArray || null,2);
};
o.paramLock = function(paramsArray)
{
ASSetPropFlags(this,paramsArray || null,7);
};
Object.combine = function(obj, oldFoo, newFoo)
{
var oldFoo_bk = obj[oldFoo];
var foo_combine = function()
{
newFoo.apply(this,arguments);
return oldFoo_bk.apply(this,arguments);
};
obj[oldFoo] = foo_combine;
};
o.paramHide();
Object.paramHide();
var o = Array.prototype;
o.nSort = function()
{
this.sort(function(a, b)
{
if(Number(a) < Number(b))
{
return -1;
}
if(Number(a) > Number(b))
{
return 1;
}
return 0;
}
);
return this;
};
o.sortOnNum = function(param)
{
this.sort(function(a, b)
{
a = a[param];
b = b[param];
if(!isNaN(a))
{
a = Number(a);
}
if(!isNaN(b))
{
b = Number(b);
}
return (a < b) * -1 || (a > b) * 1 || 0;
}
);
};
o.trim = function(searched_array, rec)
{
var l = this.length;
if(searched_array == undefined)
{
searched_array = ["",null];
}
var i = 0;
while(i < this.length)
{
if(searched_array.indexOf(this[i]) != -1 || rec && this[i].trim(searched_array,true))
{
this.splice(i,1);
i--;
}
i++;
}
return l != this.length;
};
o.match = function(searched)
{
var test = 0;
if(searched instanceof Array)
{
var i = 0;
while(i < this.length)
{
if(searched.indexOf(this[i]) != -1)
{
test++;
}
i++;
}
}
else
{
var i = 0;
while(i < this.length)
{
if(searched == this[i])
{
test++;
}
i++;
}
}
return test;
};
o.indexOf = function(searched)
{
var i = 0;
while(i < this.length)
{
if(searched == this[i])
{
return i;
}
i++;
}
return -1;
};
o.random = function()
{
var random_i = this.length;
while(random_i > 0)
{
this.push(this.splice(Math.floor(Math.random() * random_i),1)[0]);
random_i--;
}
return this;
};
o.paramHide();
var o = MovieClip.prototype;
o.movieTo = function()
{
this._x = arguments[0];
this._y = arguments[1];
};
o.movieBy = function()
{
this._x += arguments[0];
this._y += arguments[1];
};
o.size = function()
{
if(arguments[0] != null && arguments[0] != 0)
{
this._width = arguments[0];
}
if(arguments[0] != null && arguments[0] != 0)
{
this._height = arguments[1];
}
};
o.scale = function()
{
this._xscale = this._yscale = arguments[0];
};
o.scaleTo = function(xscale, yscale)
{
if(arguments[0] != null && arguments[0] != 0)
{
this._xscale = arguments[0];
}
if(arguments[1] != null && arguments[1] != 0)
{
this._yscale = arguments[1];
}
};
o.scaleBy = function()
{
this._xscale *= arguments[0];
this._yscale *= arguments[0];
};
o.rotateBy = function()
{
this._rotation += arguments[0];
};
o.hide = function()
{
this._visible = 0;
};
o.show = function()
{
this._visible = 1;
};
o.visInvert = function()
{
this._visible = !this._visible;
};
o.flipV = function()
{
this._xscale *= -1;
};
o.flipH = function()
{
this._yscale *= -1;
};
o.playOffset = function()
{
this.gotoAndPlay(this._currentframe + arguments[0]);
};
o.childs = function()
{
var result_childs = new Array();
for(var v in this)
{
if(typeof this[v] == "movieclip" && this[v]._parent == this)
{
result_childs.push(this[v]);
}
}
return result_childs;
};
o.allChilds = function()
{
if(_root.allChilds_root_movieclip == null)
{
_root.allChilds_root_movieclip = this;
}
this.allChilds_tested = true;
var result_allChilds = new Array();
for(var v in this)
{
if(typeof this[v] == "movieclip")
{
if(this[v].allChilds_tested || this[v]._parent != this)
{
continue;
}
result_allChilds.push(this[v]);
result_allChilds = result_allChilds.concat(this[v].allChilds());
}
}
if(_root.allChilds_root_movieclip == this)
{
var allChilds_i = 0;
while(allChilds_i < result_allChilds.length)
{
delete result_allChilds[allChilds_i].allChilds_tested;
allChilds_i++;
}
delete _root.allChilds_root_movieclip;
delete allChilds_tested;
}
return result_allChilds;
};
o.copy = function(fromClip, paramArray)
{
if(paramArray == null)
{
paramArray = new Array("_width","_height","_x","_y","_alpha");
}
var rotation_fromClip = fromClip._rotation;
fromClip._rotation = 0;
var rotation_thisClip = this._rotation;
this._rotation = 0;
var copy_a = 0;
while(copy_a < paramArray.length)
{
this[paramArray[copy_a]] = fromClip[paramArray[copy_a]];
copy_a++;
}
fromClip._rotation = rotation_fromClip;
this._rotation = rotation_fromClip;
};
o.copyColor = function(fromClip)
{
new Color(this).setTransform(new Color(fromClip).getTransform());
};
o.top = function()
{
if(this._parent != _root)
{
return this._parent.top();
}
return this;
};
o.AnimToPlace = function(StartA, FinishA, Steps, CurrStep, XY)
{
this[XY] = Math.inOut(StartA,FinishA,Steps,CurrStep);
};
o.newSound = function(id, volume, loop)
{
this.mySound = new Sound();
this.mySound.attachSound(id);
this.mySound.setVolume(volume || 100);
this.mySound.start(0,loop || 1);
};
o.stopSound = function(id, volume, loop)
{
this.mySound.stop();
};
o.localToLocal = function(fromMc)
{
fromMc.localToGlobal(arguments[1]);
this.globalToLocal(arguments[1]);
};
o.align = function(fromClip)
{
var b = this.getBounds(fromClip || this._parent);
if(arguments[1] != "v")
{
this._x -= (b.xMin + b.xMax) / 2;
}
if(arguments[1] != "h")
{
this._y -= (b.yMin + b.yMax) / 2;
}
};
o.alignH = function(fromClip)
{
this.align(fromClip || this._parent,"h");
};
o.alignV = function(fromClip)
{
this.align(fromClip || this._parent,"v");
};
o.setParam = function()
{
this[arguments[0]] = arguments[1];
};
o.addProperty("_brightness",function()
{
}
,function(br)
{
var b;
var c;
if(br <= 0)
{
b = 100 + br;
c = 0;
}
else
{
b = 100 - br;
c = Math.round(br / 100 * 255);
}
new Color(this).setTransform({ra:b,rb:c,ga:b,gb:c,ba:b,bb:c,aa:100,ab:0});
}
);
o.pauseInit = function()
{
var o = MovieClip.prototype;
o.played = true;
o.old_play = o.play;
o.play = function()
{
if(this.pause_local_flag)
{
return undefined;
}
this.played = true;
this.old_play();
};
o.old_gotoAndPlay = o.gotoAndPlay;
o.gotoAndPlay = function()
{
if(this.pause_local_flag)
{
return undefined;
}
this.gotoAndPlayed = true;
this.old_gotoAndPlay(arguments[0],arguments[1]);
};
o.old_stop = o.stop;
o.stop = function()
{
this.played = false;
this.old_stop();
};
o.old_gotoAndStop = o.gotoAndStop;
o.gotoAndStop = function()
{
this.played = false;
this.old_gotoAndStop(arguments[0],arguments[1]);
};
o.old_prevFrame = o.prevFrame;
o.prevFrame = function()
{
this.played = false;
this.old_prevFrame();
};
o.old_nextFrame = o.nextFrame;
o.nextFrame = function()
{
this.played = false;
this.old_nextFrame();
};
o.pauseInited = true;
o.paramHide();
};
o.pause = function(action)
{
if(!this.pauseInited)
{
this.pauseInit();
}
var action = action.toLowerCase();
if(this.paused_mc_array != undefined && action != "stop")
{
delete this.pause_flag;
var i = 0;
while(i < this.paused_mc_array.length)
{
delete this.paused_mc_array[i].pause_local_flag;
this.paused_mc_array[i].play();
i++;
}
delete this.paused_mc_array;
}
else if(this.paused_mc_array == undefined && action != "play")
{
var pause_array = this.allChilds();
pause_array.push(this);
this.paused_mc_array = new Array();
var i = 0;
while(i < pause_array.length)
{
if(pause_array[i].played && pause_array[i]._totalframes != 1)
{
pause_array[i].stop();
this.paused_mc_array.push(pause_array[i]);
pause_array[i].pause_local_flag = true;
}
i++;
}
}
};
o.creatRound = function(name, depth, radius, color)
{
var r = this.createEmptyMovieClip(name,depth);
radius = radius / 2 || 2;
r.lineStyle(radius,color || 0,100);
r.lineTo(0,0.15);
return r;
};
o.creatSqv = function(name, depth, width, color, center)
{
var sqv = this.createEmptyMovieClip(name,depth);
width = width || 1;
var s = 0;
if(center)
{
s = (- width) / 2;
}
sqv.moveTo(s,s);
sqv.beginFill(color || 0);
sqv.lineTo(width + s,s);
sqv.lineTo(width + s,width + s);
sqv.lineTo(s,width + s);
sqv.lineTo(s,s);
sqv.endFill();
return sqv;
};
o.setPixel = function()
{
var o = this.localToGlobal({x:this._x,y:this._y});
this._x -= o.x % 1;
this._y -= o.y % 1;
};
o.addProperty("_gXscale",function()
{
return this._xscale * (this._parent != undefined && (arguments.callee.apply(this._parent) || 100) / 100);
}
,function(newVal)
{
var o = this;
var s = this._xscale;
while(o = o._parent)
{
s *= o._xscale / 100;
}
newVal /= s;
this._xscale = newVal * 100;
}
);
o.addProperty("_gYscale",function()
{
return this._yscale * (this._parent != undefined && (arguments.callee.apply(this._parent) || 100) / 100);
}
,function(newVal)
{
var o = this;
var s = this._yscale;
while(o = o._parent)
{
s *= o._yscale / 100;
}
newVal /= s;
this._yscale = newVal * 100;
}
);
o.paramHide();
var o = String.prototype;
o.scrollBy = function(scrOffset)
{
var newScroll = this.scroll + scrOffset;
if(newScroll > this.maxscroll)
{
newScroll = this.maxscroll;
}
else if(newScroll < 1)
{
newScroll = 1;
}
this.scroll = newScroll;
};
o.dZero = function()
{
return Number(this).dZero();
};
o.paramHide();
var o = XMLNode.prototype;
XML.prototype.ignoreWhite = true;
o.attr = o.firstChild.attributes;
o.byName = function(node_name)
{
return this.search("nodeName",node_name);
};
o.search = function(param, value)
{
if(value != undefined && (this[param] == value || this.attributes[param] == value))
{
return this;
}
if(value == undefined && this.attributes[param] != undefined)
{
return this;
}
return this.nextSibling.search(param,value) || this.firstChild.search(param,value);
};
o.searchValue = function(value)
{
var a = this.attributes;
for(var v in a)
{
if(a[v] == value)
{
return this;
}
}
return this.nextSibling.searchValue(value) || this.firstChild.searchValue(value);
};
o.clear = function()
{
this.nextSibling.clear();
this.firstChild.clear();
if(this.nodeType == 3 && this.parentNode.firstChild != this.parentNode.lastChild)
{
this.removeNode();
}
};
o.paramHide();
var o = Math;
o.ease = function(Steps, CurrStep)
{
if(Steps <= CurrStep)
{
return 0;
}
if(Steps / 2 == CurrStep)
{
return 1;
}
var result = Math.sin(CurrStep / Steps * 180 * 3.141592653589793 / 180);
return result * result * result;
};
o.inOut = function(StartA, FinishA, Steps, CurrStep)
{
if(CurrStep >= Steps)
{
return FinishA;
}
if(CurrStep <= 0)
{
return StartA;
}
return StartA + (FinishA - StartA) * Math.ease(Steps * 2,CurrStep);
};
o.length = function(point1, point2)
{
var catet1 = this.abs(point1._x - point2._x);
var catet2 = this.abs(point1._y - point2._y);
return this.sqrt(this.pow(catet1,2) + this.pow(catet2,2));
};
o.getMiddlePoint = function(point1, point2, len)
{
var bigLen = this.length(point1,point2);
if(len == undefined)
{
len = bigLen / 2;
}
var c = bigLen / len;
var point = {};
point._x = point1._x + (point2._x - point1._x) / c;
point._y = point1._y + (point2._y - point1._y) / c;
return point;
};
o.getDeltaPoint = function(a_point, b_point, delta)
{
var rad = 57.29577951308232;
var c = this.length(a_point,b_point);
var b = this.length(a_point,delta);
var a = this.length(b_point,delta);
var angA = Math.round(Math.acos((b * b + c * c - a * a) / (2 * b * c)) * rad);
var angB = Math.round(Math.acos((a * a + c * c - b * b) / (2 * a * c)) * rad);
var angC = Math.round(Math.acos((a * a + b * b - c * c) / (2 * a * b)) * rad);
var ax = Math.round(b * Math.cos(angA / rad));
return this.getMiddlePoint(a_point,b_point,ax);
};
o.paramHide();
Stage.onCenterScale = function(w, h)
{
var o = {};
o.onResize = function()
{
var s = Stage;
var rootScale;
var tmp;
if(s.width <= 0)
{
return undefined;
}
s._xscale = s.width / w * 100;
s._yscale = s.height / h * 100;
tmp = rootScale = Math.min(s._xscale,s._yscale);
rootScale *= Stage._rootH / Stage.height;
if(rootScale > tmp)
{
rootScale = tmp;
}
_root._yscale = _root._xscale = rootScale;
_root._x = (w - w * (rootScale / 100)) / 2;
_root._y = (h - h * (rootScale / 100)) / 2;
C_AltCLASS.prototype.scale = 100 / rootScale * 100;
};
o.onKeyDown = function()
{
if(getTimer() - this.downTimer > 300)
{
var c = Key.getCode();
if(c == 187 || c == 107)
{
Stage.zoomIn();
}
else if(c == 189 || c == 109)
{
Stage.zoomOut();
}
this.downTimer = getTimer();
}
};
o.onKeyUp = function()
{
this.downTimer = 0;
};
this.zoomIn = function()
{
this._rootH = Math.round(this._rootH * 1.1);
if(this._rootH > this.height)
{
this._rootH = this.height;
}
this.saveRootParams();
Stage.broadcastMessage("onResize");
};
this.zoomOut = function()
{
if(this._rootH > this.height)
{
this._rootH = this.height;
}
this._rootH = Math.round(this._rootH / 1.1);
if(this._rootH < 100)
{
this._rootH = 100;
}
Stage.saveRootParams();
Stage.broadcastMessage("onResize");
};
this.saveRootParams = function()
{
this.so.data._rootH = this._rootH;
this.so.flush();
};
this.so = SharedObject.getLocal("stage");
if(this.so.data._rootH)
{
this._rootH = this.so.data._rootH;
}
else
{
this._rootH = this.height * 10;
}
Stage.centerScaleMode = true;
Stage._xscale = 100;
Stage._yscale = 100;
Stage.scaleMode = "noScale";
Stage.addListener(o);
Key.addListener(o);
Stage.broadcastMessage("onResize");
};
stg.paramHide();
stg = null;
delete arr;
var o = Number.prototype;
o.dZero = function()
{
if(this == 0)
{
return "0.00";
}
var dStr = String(Math.floor(this * 100));
var one = dStr.substr(0,dStr.length - 2);
if(one == "")
{
one = "0";
}
var two = dStr.substr(-2);
if(two == "0")
{
two = "00";
}
var arr_tmp = [];
var str_tmp = one;
while(str_tmp != "")
{
if(str_tmp.length < 3)
{
arr_tmp.unshift(str_tmp);
break;
}
arr_tmp.unshift(str_tmp.substr(-3));
str_tmp = str_tmp.substr(0,str_tmp.length - 3);
}
one = arr_tmp.join(",");
return one + "." + two;
};
o.paramHide();
var o = Button.prototype;
o.addProperty("_brightness",function()
{
}
,function(br)
{
var b;
var c;
if(br <= 0)
{
b = 100 + br;
c = 0;
}
else
{
b = 100 - br;
c = Math.round(br / 100 * 255);
}
new Color(this).setTransform({ra:b,rb:c,ga:b,gb:c,ba:b,bb:c,aa:100,ab:0});
}
);
o.paramHide();
_global.isXML = function(x)
{
return x instanceof XML || x instanceof XMLNode;
};
_global.c__ = {};
c__[1] = function()
{
Conv.include.apply(Conv,arguments);
};
c__[2] = function()
{
Conv.put.apply(Conv,arguments);
};
c__[3] = function()
{
Conv.anim.apply(Conv,arguments);
};
ASSetPropFlags(_global,"isXML,c__",131);
_global.C_ConveyorCLASS = function()
{
this.init();
};
C_ConveyorCLASS.prototype.init = function()
{
if(!_root.anim_depth)
{
_global.anim_depth = _root.createEmptyMovieClip("anim_depth",15400);
}
this.aConveyor = new Array();
this.bConveyor = new Array();
this.conveyorON = true;
this.bookmark = 0;
this.shorts = 0;
this.turbo = false;
this.noSound = false;
_root.createEmptyMovieClip("ConvTimer",-9122);
_root.ConvTimer.onEnterFrame = function()
{
if(this.sleep)
{
return undefined;
}
this.nTime = this.nTime + 1;
if(this.nTime >= this.timeOut)
{
Conv[1]();
}
};
this[1]();
};
C_ConveyorCLASS.prototype.play = function()
{
if(this.conveyorON)
{
return undefined;
}
if(this.frame)
{
_root.ConvTimer.sleep = false;
}
this.aConveyor = this.aConveyor.concat(this.bConveyor);
this.bConveyor = new Array();
this.conveyorON = true;
};
C_ConveyorCLASS.prototype.stop = function()
{
if(this.frame)
{
_root.ConvTimer.sleep = true;
}
this.conveyorON = false;
};
C_ConveyorCLASS.prototype.put = function()
{
if(this.noSound && arguments[1] == "newSound")
{
return undefined;
}
var tmp_array = [];
var i = 0;
while(i < arguments.length)
{
tmp_array.push(arguments[i]);
i++;
}
if(this.conveyorON)
{
this.aConveyor.push(tmp_array);
if(!this.bookmark && this.aConveyor.length > 200 + this.shorts)
{
var tmp_arr = this.aConveyor.splice(100 + this.shorts);
this.shorts = this.shorts + 1;
this.put(function()
{
Conv.aConveyor = arguments[0].concat(Conv.aConveyor);
Conv.shorts--;
}
,0,tmp_arr);
}
}
else
{
this.bConveyor.push(tmp_array);
}
};
C_ConveyorCLASS.prototype.include = function()
{
this.put(this,3,0);
var tmp_array = [];
var i = 0;
while(i < arguments.length)
{
tmp_array.push(arguments[i]);
i++;
}
if(this.conveyorON)
{
this.aConveyor.push(tmp_array);
}
else
{
this.bConveyor.push(tmp_array);
}
this.put(this,2,0);
};
C_ConveyorCLASS.prototype.put_a = function()
{
this.aConveyor.push(arguments);
};
C_ConveyorCLASS.prototype.anim = function(mc_anim, mc_to, params_ob)
{
var to_end = params_ob.to_end * 1;
var speed = params_ob.speed || 20;
var acsel = params_ob.acsel * 1 || 1;
var scale = params_ob.scale;
var x_f = params_ob.xy.x || mc_to._x;
var y_f = params_ob.xy.y || mc_to._y;
var delta = params_ob.delta;
if(!mc_to)
{
mc_to = {_x:x_f,_y:y_f};
}
var x;
var y;
var x_s;
var y_s;
var x_st = mc_anim._x;
var y_st = mc_anim._y;
if(scale)
{
var scale_x = mc_anim._xscale;
var scale_y = mc_anim._yscale;
var scale_to_x = mc_to._xscale;
var scale_to_y = mc_to._yscale;
}
this.put(mc_anim,"swapDepths",0,_root.anim_depth);
this.put(_root,"newSound",0,"movie",50);
var pathLength = Math.length(mc_anim,mc_to);
var nSteps = Math.round(pathLength / speed / acsel);
if(isNaN(nSteps))
{
return undefined;
}
if(nSteps < 3)
{
nSteps = 3;
}
var i = 1;
while(i <= nSteps)
{
if(!to_end && i >= nSteps - nSteps / 5)
{
break;
}
if(this.turbo)
{
i = !to_end ? nSteps - nSteps / 5 : nSteps;
}
if(scale)
{
x_s = Math.inOut(scale_x,scale_to_x,nSteps,i);
y_s = Math.inOut(scale_y,scale_to_y,nSteps,i);
this.put(mc_anim,"scaleTo",0,x_s,y_s);
}
x = Math.inOut(x_st,x_f,nSteps,i);
y = Math.inOut(y_st,y_f,nSteps,i);
this.put(mc_anim,"movieTo","1",x,y);
i++;
}
this.put(mc_anim,"swapDepths","1",_root.anim_depth);
};
C_ConveyorCLASS.prototype.turbo_On = function()
{
this.turbo = true;
};
C_ConveyorCLASS.prototype.turbo_Off = function()
{
this.turbo = false;
};
var a = [function(pause)
{
this.aConveyor = [[function()
{
},pause]].concat(this.aConveyor);
},function()
{
if(!this.conveyorON)
{
this[0](500);
}
var cTime;
var tA = this.aConveyor[0];
if(this.aConveyor.length == 0)
{
cTime = "1";
}
else
{
this.aConveyor.shift();
var calledFunction;
var calledObject = _root;
var argumentsObject;
if(typeof tA[0] != "function")
{
if(typeof tA[0] == "string")
{
calledObject = eval(tA[0]);
}
else
{
calledObject = tA[0];
}
cTime = tA[2];
calledFunction = calledObject[tA[1]];
argumentsObject = tA.slice(3);
}
else
{
cTime = tA[1];
calledFunction = tA[0];
argumentsObject = tA.slice(2);
}
calledFunction.apply(calledObject,argumentsObject);
}
clearInterval(this.interval);
if(cTime != 0)
{
var timeType = typeof cTime;
var timeValue = Number(cTime);
if(timeType == "string")
{
_root.ConvTimer.sleep = false;
if(this.turbo)
{
timeValue = 1;
}
_root.ConvTimer.timeOut = timeValue;
_root.ConvTimer.nTime = 0;
this.frame = true;
}
else if(timeType == "number")
{
_root.ConvTimer.sleep = true;
this.interval = setInterval(this,1,timeValue);
this.frame = false;
}
else
{
this[1]();
}
}
else
{
this[1]();
}
},function(rev)
{
if(this.bookmark <= 0)
{
return undefined;
}
this.bookmark--;
var n = this.aConveyor.length;
var tmp_array = [];
while(this.aConveyor[this.aConveyor.length - 1] != "#bookmark#" && n-- > 0)
{
tmp_array.push(this.aConveyor.pop());
}
this.aConveyor.pop();
if(!rev)
{
tmp_array.reverse();
}
this.aConveyor = tmp_array.concat(this.aConveyor);
},function()
{
this.aConveyor.push("#bookmark#");
this.bookmark = this.bookmark + 1;
}];
var i = 0;
while(i < a.length)
{
C_ConveyorCLASS.prototype[i] = a[i];
i++;
}
delete a;
delete i;
_global.empty = function()
{
};
_global.Conv = new C_ConveyorCLASS();
ASSetPropFlags(_global,"Conv,empty,anim_depth,addConveyor",131);
ASSetPropFlags(_global,"C_ConveyorCLASS",131);
_global.Image = function(uri, mc)
{
this._targetMovie = mc;
this.data = new XML();
this.data.owner = this;
if(uri != undefined)
{
this.tmp_interval = setInterval(this,"load",20,uri);
}
};
Image.prototype.load = function(uri, mc)
{
clearInterval(this.tmp_interval);
this._targetMovie = mc || this._targetMovie;
this._uri = uri;
this.data.onLoad = function(success)
{
var o = this.owner;
o._trace();
o.onLoad(success);
o.close();
};
this._traceID = setInterval(this,"_trace",50);
this.data.load(uri);
};
Image.prototype.close = function(uri, mc)
{
clearInterval(this._traceID);
};
Image.prototype.getBytesLoaded = function()
{
return this.data.getBytesLoaded();
};
Image.prototype.getBytesTotal = function()
{
return this.data.getBytesTotal();
};
Image.prototype._trace = function()
{
if(this.getBytesTotal() <= 0)
{
return undefined;
}
this.percent = Math.floor(this.getBytesLoaded() / this.getBytesTotal() * 10000) / 100;
this.trace();
};
Image.prototype.trace = function()
{
};
Image.prototype.onLoad = function(success)
{
if(success)
{
if(this._targetMovie)
{
this._targetMovie.loadMovie(this._uri);
}
}
};
Image.prototype.addProperty("src",function()
{
return this._uri;
}
,Image.prototype.load);
ASSetPropFlags(_global,"Image",131);
_global.Preloader = function()
{
this.items = [];
var i = 0;
while(i < arguments.length)
{
this.addItem(arguments[i]);
i++;
}
};
Preloader.prototype.addItem = function()
{
var o;
var a;
if(arguments[0] instanceof Array)
{
a = arguments[0];
}
else
{
a = arguments;
}
var i = 0;
while(i < a.length)
{
o = new Image();
o.owner = this;
o.onLoad = function(s)
{
this.owner.onItemLoaded(s);
};
this.items.push([o,a[i]]);
this.loadInited = true;
i++;
}
if(!this.curentLoad)
{
this.onItemLoaded();
}
return o;
};
Preloader.prototype.onItemLoaded = function(success)
{
var o = this.curentLoad = this.items.shift();
if(this.curentLoad)
{
o[0].load(o[1]);
}
else if(this.loadInited)
{
this.onLoad();
}
};
Preloader.prototype.onLoad = function()
{
this.trace("Loading Complette");
};
ASSetPropFlags(_global,"Preloader",131);
var mc = MovieClip.prototype;
var btn = Button.prototype;
var text = TextField.prototype;
Stage.initElastic = function(w, h, min_w, min_h)
{
if(this.elsticParams != undefined)
{
return false;
}
this.scaleMode = "noScale";
this.align = "TL";
this.elsticParams = {};
this.elsticParams.min_h = min_h || h;
this.elsticParams.min_w = min_w || w;
this.elsticParams.width = w;
this.elsticParams.height = h;
this.elsticParams.onResize = function()
{
var o = Stage;
if(o.width <= 0 || o.height <= 0)
{
this.lock = true;
return undefined;
}
this.lock = false;
var w = o.width >= this.min_w ? o.width : this.min_w;
var h = o.height >= this.min_h ? o.height : this.min_h;
this.w_d = Math.floor(w) - this.width;
this.h_d = Math.floor(h) - this.height;
this.width = w;
this.height = h;
return true;
};
this.addListener(this.elsticParams);
};
Stage.deleteElastic = function()
{
this.removeListener(this.elsticParams);
delete this.elsticParams;
};
mc.registerElastic = btn.registerElastic = text.registerElastic = function()
{
var o = Stage.elsticParams;
if(o == undefined)
{
return false;
}
this.onResize = function()
{
var o = Stage.elsticParams;
if(o.lock)
{
return undefined;
}
var actions = arguments.callee.actions;
var value;
var i = 0;
while(i < actions.length)
{
this[actions[i][1]] += o[actions[i][0]];
i++;
}
};
var a = this.onResize.actions = [];
var params = {};
params.x = ["w_d","_x"];
params.w = ["w_d","_width"];
params.y = ["h_d","_y"];
params.h = ["h_d","_height"];
var i = 0;
while(i < arguments.length)
{
a.push(params[arguments[i]]);
i++;
}
Stage.addListener(this);
return true;
};
mc.registerInterfaceElastic = function()
{
this.onResize = function()
{
var o = Stage.elsticParams;
if(o.lock)
{
return undefined;
}
var actions = arguments.callee.actions;
var value;
var §interface§ = arguments.callee["interface"];
var args = [];
var i = 0;
while(i < actions.length)
{
this[actions[i][1]] += o[actions[i][0]];
i++;
}
if(eval("interface").w)
{
args.push(this.width + o.w_d);
}
else if(eval("interface").w_l)
{
args.push(this.width);
}
if(eval("interface").h)
{
args.push(this.height + o.h_d);
}
else if(eval("interface").h_l)
{
args.push(this.height);
}
this.setSize.apply(this,args);
};
var a = this.onResize.actions = [];
var §interface§ = this.onResize["interface"] = {};
var params = {};
params.x = ["w_d","_x"];
params.y = ["h_d","_y"];
var i = 0;
while(i < arguments.length)
{
if(params[arguments[i]])
{
a.push(params[arguments[i]]);
}
else
{
eval("interface")[arguments[i]] = true;
}
i++;
}
Stage.addListener(this);
return true;
};
mc.unregisterElastic = btn.unregisterElastic = text.unregisterElastic = function()
{
Stage.removeListener(this);
delete this.onResize;
};
mc.paramHide();
btn.paramHide();
text.paramHide();
delete mc;
delete btn;
delete text;
_global.C_AltCLASS = function(text, owner)
{
this.owner = owner;
this.init();
this[2](text);
};
C_AltCLASS.prototype = new Object();
C_AltCLASS.prototype.counter = 0;
C_AltCLASS.prototype.depth = 23499;
C_AltCLASS.prototype.fill = 16777164;
C_AltCLASS.prototype.lineColor = 0;
C_AltCLASS.prototype.align = "BL";
C_AltCLASS.prototype.scale = 100;
var o = C_AltCLASS.prototype.textFormat = new TextFormat();
o.font = "_sans";
o.size = 10;
o.textColor = 0;
o.bold = true;
o.indent = 0;
delete o;
C_AltCLASS.prototype.init = function()
{
Stage.addListener(this);
Mouse.addListener(this);
var o = this.closeListener = {};
o.owner = this;
o.onMouseDown = o.onKeyDown = o.onKeyUp = function()
{
var o = this.owner.owner;
if(o)
{
o.hideAlt();
}
else
{
this.owner[3]();
}
};
Key.addListener(o);
Mouse.addListener(o);
};
C_AltCLASS.prototype.onMouseMove = function()
{
if(!this.owner.__alt)
{
this[3]();
return undefined;
}
if(!this.point)
{
this.holder._x = _root._xmouse;
this.holder._y = _root._ymouse;
}
else
{
this.holder._x = this.point._x;
this.holder._y = this.point._y;
}
this.holder._xscale = this.holder._yscale = this.scale;
var x = this.holder._x;
var y = this.holder._y;
var w = this.holder._width;
var h = this.holder._height;
var a = this.align;
var v = "B";
var g = "L";
if(Stage.centerScaleMode)
{
if(y - h < 0)
{
v = "T";
}
if(x + w > Stage.width / (Stage._xscale / 100))
{
g = "R";
}
}
else
{
if(Stage.height > 0 && h > y)
{
v = "T";
}
if(Stage.width > 0 && Stage.width - w < x)
{
g = "R";
}
}
this.align = v + g;
if(this.align != a)
{
this[4]();
}
};
var a = [function()
{
this.onMouseMove();
},function()
{
var o = this.holder;
o._visible = true;
var t = o.alt_txt;
var w = t._width;
var h = t._height;
var x = o._xmouse;
var y = o._ymouse;
var b = this.border_mc = o.createEmptyMovieClip("border",2);
b.beginFill(this.fill,100);
b.lineStyle(0);
b.lineTo(12,-12);
b.lineTo(12 + w + 4,-12);
b.lineTo(12 + w + 4,-12 - h - 4);
b.lineTo(8,-12 - h - 4);
b.lineTo(8,-19);
b.endFill();
var a = b.createEmptyMovieClip("aligner",1);
b = this.shadow_mc = o.createEmptyMovieClip("shadow",1);
b.beginFill(0,30);
var d = 7;
b.lineTo(12 + d,-12 + d);
b.lineTo(12 + w + 4 + d,-12 + d);
b.lineTo(12 + w + 4 + d,-12 - h - 4 + d);
b.lineTo(8 + d,-12 - h - 4 + d);
b.lineTo(8 + d,-19 + d);
b.endFill();
a.beginFill(this.fill);
a.moveTo(12,-15);
a.lineTo(12 + w,-15);
a.lineTo(12 + w,-12 - h);
a.lineTo(12,-12 - h);
a.endFill();
this[4]();
this.onMouseMove();
},function(text)
{
if(this.__proto__.curent)
{
this.__proto__.curent.owner.hideAlt();
}
this.__proto__.curent = this;
var o = this.holder = _root.createEmptyMovieClip("alt_" + c + "_mc",this.depth);
this.holder._xscale = this.holder._yscale = this.scale;
o.owner = this;
o.onEnterFrame = function()
{
delete this.onEnterFrame;
this.owner[1]();
};
o._visible = false;
o._x = _root._xmouse;
o._y = _root._ymouse;
o.createTextField("alt_txt",123,0,0,10,10);
var t = o.alt_txt;
t.border = false;
t.multiline = true;
t.autoSize = true;
t.selectable = false;
t.text = text;
t.setTextFormat(this.textFormat);
},function()
{
this.holder.removeMovieClip();
Stage.removeListener(this);
Mouse.removeListener(this);
Key.removeListener(this.closeListener);
Mouse.removeListener(this.closeListener);
},function()
{
var o = this.holder;
if(this.align == undefined)
{
this.align = "BL";
}
if(this.align == "BL")
{
o.border._xscale = o.shadow._xscale = 100;
o.border._yscale = o.shadow._yscale = 100;
o.shadow._x = o.shadow._y = 0;
}
else if(this.align == "BR")
{
o.border._xscale = o.shadow._xscale = -100;
o.border._yscale = o.shadow._yscale = 100;
o.shadow._x = 0;
o.shadow._y = 0;
}
else if(this.align == "TL")
{
o.border._xscale = o.shadow._xscale = 100;
o.border._yscale = o.shadow._yscale = -100;
o.shadow._x = 0;
o.shadow._y = 10;
}
else if(this.align == "TR")
{
o.border._xscale = o.shadow._xscale = -100;
o.border._yscale = o.shadow._yscale = -100;
o.shadow._x = 0;
o.shadow._y = 10;
}
var p = o.border.aligner.getBounds(o);
o.alt_txt._x = p.xMin;
o.alt_txt._y = p.yMin - 2;
}];
var i = 0;
while(i < a.length)
{
C_AltCLASS.prototype[i] = a[i];
i++;
}
delete a;
delete i;
ASSetPropFlags(_global,"C_AltCLASS",131);
Button.prototype.showAlt = MovieClip.prototype.showAlt = function(text)
{
if(this.__alt)
{
this.hideAlt();
}
this.__alt = new C_AltCLASS(text,this);
};
MovieClip.prototype.showAltInPoint = function(text, point)
{
if(this.__alt)
{
this.hideAlt();
}
var o = this.__alt = new C_AltCLASS(text,this);
o.point = point;
};
Button.prototype.hideAlt = MovieClip.prototype.hideAlt = function()
{
this.__alt[3]();
delete this.__alt;
};
Button.prototype.addAlt = MovieClip.prototype.addAlt = function(t)
{
var o = this;
var fIn = function()
{
this.showAlt(t);
};
var fOut = function()
{
this.hideAlt();
};
if(arguments.length > 1)
{
fIn = arguments[0];
fOut = arguments[1];
}
o.onRollOver = fIn;
o.onDragOut = o.onRollOut = o.onPress = o.onRelease = o.onReleaseOutside = fOut;
o.useHandCursor = false;
};
Mouse.showAlt = function(text)
{
var b = _root.creatSqv("tmp_sqv_alt",8919,10,0,true);
b._alpha = 0;
b._x = _root._xmouse;
b._y = _root._ymouse;
b.showAlt(text);
b.onRollOut = b.onPress = b.onRelease = b.onReleaseOutside = b.onDragOut = function()
{
this.hideAlt();
_root.tmp_sqv_alt.removeMovieClip();
};
};
ASSetPropFlags(MovieClip.prototype,"showAlt,hideAlt,addAlt",131);
ASSetPropFlags(Button.prototype,"showAlt,hideAlt,addAlt",131);
ASSetPropFlags(Button,"showAlt",131);
_global.C_My = {};
C_My.dZerro = function()
{
if(arguments[0] == 0)
{
return "0.00";
}
var dStr = String(Math.floor(arguments[0] * 100));
var one = dStr.substr(0,dStr.length - 2);
if(one == "")
{
one = "0";
}
var two = dStr.substr(-2);
if(two == "0")
{
two = "00";
}
var arr_tmp = [];
var str_tmp = one;
while(str_tmp != "")
{
if(str_tmp.length < 3)
{
arr_tmp.unshift(str_tmp);
break;
}
arr_tmp.unshift(str_tmp.substr(-3));
str_tmp = str_tmp.substr(0,str_tmp.length - 3);
}
one = arr_tmp.join(",");
return one + "." + two;
};
C_My.paramHide();
ASSetPropFlags(_global,"C_My",131);
if(!MMSAVE("text_test.txt",_url))
{
_global.JS = {};
}
_global.JS.alert = function(msg)
{
getURL("javascript: void top.alert(\'" + msg + "\');","");
};
_global.JS.focus = function()
{
getUrl("javascript: void top.focus();", "");
};
_global.JS.close = function()
{
getUrl("javascript: void top.close();", "");
};
_global.JS.call = function(msg)
{
getURL("javascript: void " + msg,"");
};
ASSetPropFlags(_global,"JS",131);
if(AsBroadcaster == undefined)
{
_global.ASBroadcaster = {};
ASBroadcaster.initialize = function(obj)
{
obj.addListener = this.addListener;
obj.removeListener = this.removeListener;
obj.broadcastMessage = this.broadcastMessage;
obj._listeners = [];
ASSetPropFlags(obj,["addListener","removeListener","broadcastMessage","_listeners"],7);
};
ASBroadcaster.addListener = function(obj)
{
this.removeListener(obj);
this._listeners.push(obj);
return true;
};
ASBroadcaster.removeListener = function(obj)
{
var a = this._listeners;
var i = this._listeners.length;
while(--i)
{
if(a[i] == obj)
{
a.splice(i,1);
return true;
}
}
return false;
};
ASBroadcaster.broadcastMessage = function(theEvent)
{
var a = this._listeners;
var i = this._listeners.length;
while(--i)
{
a[i][theEvent]();
}
};
ASSetPropFlags(ASBroadcaster,null,7);
ASSetPropFlags(_global,"ASBroadcaster",131);
}
Button.prototype.tabEnabled = false;
MovieClip.prototype.tabEnabled = false;
ASSetPropFlags(Button.prototype,"tabEnabled",7);
ASSetPropFlags(MovieClip.prototype,"tabEnabled",7);
delete o;
}
hello = "Hello Source Viewers! ;) Code Created by 3WGRAPHICS.net";
delete hello;
_global.C_SlotCLASS = function()
{
this.curBet = 5;
this.nCoins = 1;
this.maxCoins = 3;
this.userBalance = 10000;
this.win = 0;
this.nReels = 3;
this.table = {};
this.table.line_1 = {prize:[3,6,9],prizeCalculate:function(s1, s2, s3, nCoins)
{
var a = [s1,s2,s3];
var s;
var symbols = [];
var numSymbols = 0;
var i = 0;
while(i < a.length)
{
s = a[i];
if(s == "x")
{
return undefined;
}
if(s == "Cherry")
{
numSymbols++;
symbols.push(1);
}
else
{
symbols.push(0);
}
i++;
}
if(numSymbols < 1)
{
return undefined;
}
var o = {};
o.prize = this.prize[nCoins - 1];
o.symbols = symbols;
return o;
}};
this.table.line_2 = {prize:[5,10,15],prizeCalculate:function(s1, s2, s3, nCoins)
{
var a = [s1,s2,s3];
var s;
var symbols = [];
var numSymbols = 0;
var i = 0;
while(i < a.length)
{
s = a[i];
if(s == "x")
{
return undefined;
}
if(s == "Cherry")
{
numSymbols++;
symbols.push(1);
}
else
{
symbols.push(0);
}
i++;
}
if(numSymbols < 3)
{
return undefined;
}
var o = {};
o.prize = this.prize[nCoins - 1];
o.symbols = symbols;
return o;
}};
this.table.line_3 = {prize:[10,20,30],prizeCalculate:function(s1, s2, s3, nCoins)
{
if(s1 + s2 + s3 != "LimonLimonLimon")
{
return undefined;
}
var o = {};
o.prize = this.prize[nCoins - 1];
o.symbols = [1,1,1];
return o;
}};
this.table.line_4 = {prize:[10,20,30],prizeCalculate:function(s1, s2, s3, nCoins)
{
if(s1 + s2 + s3 != "OrangeOrangeOrange")
{
return undefined;
}
var o = {};
o.prize = this.prize[nCoins - 1];
o.symbols = [1,1,1];
return o;
}};
this.table.line_5 = {prize:[10,20,30],prizeCalculate:function(s1, s2, s3, nCoins)
{
if(s1 + s2 + s3 != "PlumPlumPlum")
{
return undefined;
}
var o = {};
o.prize = this.prize[nCoins - 1];
o.symbols = [1,1,1];
return o;
}};
this.table.line_6 = {prize:[10,20,30],prizeCalculate:function(s1, s2, s3, nCoins)
{
if(s1 + s2 + s3 != "MelonMelonMelon")
{
return undefined;
}
var o = {};
o.prize = this.prize[nCoins - 1];
o.symbols = [1,1,1];
return o;
}};
this.table.line_7 = {prize:[20,40,60],prizeCalculate:function(s1, s2, s3, nCoins)
{
if(s1 + s2 + s3 != "B1B1B1")
{
return undefined;
}
var o = {};
o.prize = this.prize[nCoins - 1];
o.symbols = [1,1,1];
return o;
}};
this.table.line_8 = {prize:[40,80,120],prizeCalculate:function(s1, s2, s3, nCoins)
{
if(s1 + s2 + s3 != "B2B2B2")
{
return undefined;
}
var o = {};
o.prize = this.prize[nCoins - 1];
o.symbols = [1,1,1];
return o;
}};
this.table.line_9 = {prize:[80,160,240],prizeCalculate:function(s1, s2, s3, nCoins)
{
if(s1 + s2 + s3 != "B3B3B3")
{
return undefined;
}
var o = {};
o.prize = this.prize[nCoins - 1];
o.symbols = [1,1,1];
return o;
}};
this.table.line_10 = {prize:[5,10,15],prizeCalculate:function(s1, s2, s3, nCoins)
{
var a = [s1,s2,s3];
var s;
var symbols = [];
var numSymbols = 0;
var i = 0;
while(i < a.length)
{
s = a[i];
if(s == "x")
{
return undefined;
}
if(s == "Fruits")
{
numSymbols++;
symbols.push(1);
}
else
{
symbols.push(0);
}
i++;
}
if(numSymbols < 1)
{
return undefined;
}
var o = {};
o.prize = this.prize[nCoins - 1];
o.symbols = symbols;
return o;
}};
this.table.line_11 = {prize:[25,50,75],prizeCalculate:function(s1, s2, s3, nCoins)
{
var a = [s1,s2,s3];
var s;
var symbols = [];
var numSymbols = 0;
var i = 0;
while(i < a.length)
{
s = a[i];
if(s == "x")
{
return undefined;
}
if(s == "Fruits")
{
numSymbols++;
symbols.push(1);
}
else
{
symbols.push(0);
}
i++;
}
if(numSymbols < 2)
{
return undefined;
}
var o = {};
o.prize = this.prize[nCoins - 1];
o.symbols = symbols;
return o;
}};
this.table.line_12 = {prize:[250,500,2500],prizeCalculate:function(s1, s2, s3, nCoins)
{
if(s1 + s2 + s3 != "FruitsFruitsFruits")
{
return undefined;
}
var o = {};
o.prize = this.prize[nCoins - 1];
o.symbols = [1,1,1];
return o;
}};
this.table.lines = 12;
this.reel = {};
this.reel.reel_1 = ["B3","x","B1","x","B2","x","Cherry","x","Fruits","x","Plum","x","Limon","x","Orange","x","Melon","x"];
this.reel.reel_2 = this.reel.reel_1;
this.reel.reel_3 = this.reel.reel_1;
this.reel.reel_4 = this.reel.reel_1;
this.reel.reel_5 = this.reel.reel_1;
this.reelLength = this.reel.reel_1.length;
this.reelMap = {};
this.reelMap.line_1 = [[1,1],[1,2],[1,3]];
this.reelMap.line_2 = [[2,1],[2,2],[2,3]];
this.reelMap.line_3 = [[3,1],[3,2],[3,3]];
this.reelMap.line_4 = [[2,1],[1,2],[3,3]];
this.reelMap.line_5 = [[3,1],[1,2],[2,3]];
this.init();
};
C_SlotCLASS.prototype = new Object();
C_SlotCLASS.prototype.init = function()
{
var b = _root.dealButton_btn;
b.root = this;
b.addAlt("Start reels spin");
b.onRelease = function()
{
this.hideAlt();
Conv.put(this.root,"deal",0);
};
b.useHandCursor = true;
this.onMouseDown = function()
{
if(this.waitUserActions)
{
this.doUserActions();
}
};
Mouse.addListener(this);
this.creatRandomReels();
this.setReelsPositions();
_root.reelsLinesButtons_mc.setChangeHandler(this,"setReelLines");
this.setReelLines(1);
_root.tablePrizes_mc.setChangeHandler(this,"setNumberCoins");
_root.coinMenu_mc.setChangeHandler(this,"setNumberCoins");
_root.coinSizeMenu_mc.setChangeHandler("changeCoin",this);
_root.spinButton_mc.setChangeHandler("deal",this);
_root.spinButton_mc.setKeys(13,32);
this.setNumberCoins(1);
this.changeCoin(1);
Stage.onCenterScale(640,530);
Button.prototype.tabEnabled = false;
MovieClip.prototype.tabEnabled = false;
this.updatePrizeTable();
};
C_SlotCLASS.prototype.deal = function()
{
if(this.userBalance < this.bet)
{
Mouse.showAlt("You do not have enough money for betting. \rPlease visit the cashier \ror place a smaller bet if possible.");
return undefined;
}
if(this.waitUserActions)
{
this.doUserActions();
}
if(this.locked)
{
return undefined;
}
this.lock();
this.win = 0;
_root.messageDisplay = "";
this.userBalance -= this.bet;
_root.balanceMashine_mc.balance = this.userBalance;
_root.newSound("insertCoin",100,this.numberCoins);
this.waitUserActions = true;
Conv.put(this,"hideReelsLines","6");
Conv.put(this,"startAnim",(random(5) + 5) * 100);
this.creatRandomReels();
if(_level5)
{
C_Server.round(this.bet,this.numberCoins,this.reelLines);
return undefined;
}
this.calculate();
this.displayGameResult();
Conv.put(this,"unlock",0);
};
C_SlotCLASS.prototype.lock = function()
{
this.locked = true;
_root.dealButton_btn._alpha = 50;
_root.coinSizeMenu_mc.lock();
_root.spinButton_mc.lock();
this.animLock();
Button.prototype.enabled = false;
MovieClip.prototype.enabled = false;
};
C_SlotCLASS.prototype.unlock = function()
{
this.locked = false;
_root.dealButton_btn._alpha = 100;
_root.coinSizeMenu_mc.unlock();
_root.spinButton_mc.unlock();
Button.prototype.enabled = true;
MovieClip.prototype.enabled;
if(!this.isWin)
{
this.animUnlock();
}
};
C_SlotCLASS.prototype.displayGameResult = function()
{
Conv.include(this,"animReelsPositions",0);
Conv.include(this,"displayPrize","1");
Conv.put(this,"display","1");
if(this.isWin)
{
Conv.put(this,"blinkReels","1");
Conv.put(this,"playWinAnim","1");
}
};
C_SlotCLASS.prototype.displayPrize = function()
{
if(!this.isWin)
{
return undefined;
}
var a;
var m;
var r;
var i = 1;
while(i <= this.nReels)
{
r = _root["reel_" + i + "_mc"].reel_mc;
a = r.symbols;
var j = 0;
while(j < a.length)
{
a[j]._brightness = 70;
j++;
}
i++;
}
a = this.prizeInfo;
var line;
var symbols;
var lines_array = [];
var rows_array = {};
var i = 0;
while(i < a.length)
{
line = a[i].line;
symbols = a[i].symbols;
m = this.reelMap["line_" + line];
lines_array.push(line);
rows_array[a[i].row] = true;
var mc;
var j = 0;
while(j < symbols.length)
{
if(symbols[j])
{
mc = _root["reel_" + m[j][1] + "_mc"].reel_mc["reelSimbols" + m[j][0] + "_mc"];
mc._brightness = 0;
}
j++;
}
this.win += a[i].prize;
i++;
}
this.win *= this.coin;
_root.reelsLines_mc.showLines(lines_array);
_root.reelsLines_mc._visible = 1;
this.prizeLines = lines_array;
var o = rows_array;
rows_array = [];
for(var v in o)
{
rows_array.push(v);
}
_root.tablePrizes_mc.displayPrize(rows_array);
this.userBalance += this.win;
if(_level5)
{
this.userBalance = this.userBalance_from_server;
}
_root.newSound("win");
};
C_SlotCLASS.prototype.display = function()
{
this.bet = this.numberCoins * this.reelLines * this.coin;
var betText = "Total Bet: $" + this.bet.dZero();
var linesText = this.reelLines + " Line";
if(this.reelLines > 1)
{
linesText += "s";
}
var coinsText = this.numberCoins + " Coin";
if(this.numberCoins > 1)
{
coinsText += "s";
}
var winText = "You Win: $" + this.win.dZero();
_root.totalBet_mc.setText(betText);
_root.totalLines_mc.setText(coinsText + ", " + linesText);
_root.totalWin_mc.setText(winText);
_root.balanceMashine_mc.balance = this.userBalance;
};
C_SlotCLASS.prototype.doUserActions = function()
{
if(this.locked)
{
return undefined;
}
this.waitUserActions = false;
if(this.win)
{
var r;
var a;
var i = 1;
while(i <= this.nReels)
{
r = _root["reel_" + i + "_mc"].reel_mc;
a = r.symbols;
var j = 0;
while(j < a.length)
{
a[j]._brightness = 0;
j++;
}
i++;
}
_root.tablePrizes_mc.setCoins(this.numberCoins);
_root.reelsLines_mc.blink();
var lines = this.reelLines;
this.reelLines = undefined;
this.setReelLines(lines);
}
this.showReelsLines();
if(this.isWin)
{
this.animUnlock();
}
};
C_SlotCLASS.prototype.calculate = function()
{
this.prizeInfo = [];
var line;
var prizeInfo;
var i = 1;
while(i <= this.reelLines)
{
line = C_Slot.getLineSymbols(C_Slot.getLine(i));
prizeInfo = this.checkPrize(line,i);
if(prizeInfo)
{
prizeInfo.line = i;
this.prizeInfo.push(prizeInfo);
}
i++;
}
this.isWin = this.prizeInfo.length > 0;
};
C_SlotCLASS.prototype.checkPrize = function(lineSymbols_array)
{
var prizeInfo;
var o;
var results_array = [];
lineSymbols_array.push(this.numberCoins);
var i = 1;
while(i <= this.table.lines)
{
o = this.table["line_" + i];
prizeInfo = o.prizeCalculate.apply(o,lineSymbols_array);
prizeInfo.row = i;
results_array.push(prizeInfo);
i++;
}
results_array.sortOnNum("prize");
return results_array.pop();
};
C_SlotCLASS.prototype.creatRandomReels = function()
{
this.randomReels = [];
var randomPos;
var i = 0;
while(i < this.nReels)
{
randomPos = Math.floor(Math.random() * this.reelLength) + 1;
this.randomReels.push(randomPos);
i++;
}
return this.randomReels;
};
C_SlotCLASS.prototype.getLine = function(nLine)
{
var map = this.reelMap["line_" + nLine];
var lineArray = [];
var reelPos;
var i = 0;
while(i < map.length)
{
if(map[i][0] == 1)
{
reelPos = this.randomReels[i];
}
else if(map[i][0] == 2)
{
reelPos = this.randomReels[i] + 1;
if(reelPos > this.reelLength)
{
reelPos %= this.reelLength;
}
}
else if(map[i][0] == 3)
{
reelPos = this.randomReels[i] - 1;
if(reelPos == 0)
{
reelPos = this.reelLength;
}
}
lineArray.push(reelPos);
i++;
}
return lineArray;
};
C_SlotCLASS.prototype.getLineSymbols = function(lineArray)
{
var curReel;
var lineSymbolsArray = [];
var i = 0;
while(i < lineArray.length)
{
lineSymbolsArray.push(this.reel["reel_" + (i + 1)][lineArray[i] - 1]);
i++;
}
return lineSymbolsArray;
};
C_SlotCLASS.prototype.setReelsPositions = function()
{
var reel;
var i = 0;
while(i < this.randomReels.length)
{
reel = _root["reel_" + (i + 1) + "_mc"];
reel.blurAnim.stop();
reel.blurAnim.hide();
reel.reel_mc.setPos(this.randomReels[i]);
i++;
}
};
C_SlotCLASS.prototype.animReelsPositions = function()
{
var reel;
var i = 0;
while(i < this.randomReels.length)
{
reel = _root["reel_" + (i + 1) + "_mc"];
Conv.put(reel.blurAnim,"stop",0);
Conv.put(reel.blurAnim,"hide",0);
Conv.put(reel.reel_mc,"set",0,"_y",reel.reel_mc._y - 2);
Conv.put(reel.reel_mc,"setPos","1",this.randomReels[i]);
if(i == this.randomReels.length - 1)
{
Conv.put(this.soundSpinHolder,"stopSound",0);
Conv.put(this.soundSpinHolder,"removeMovieClip",0);
}
Conv.put(reel.reel_mc,"newSound",0,"reelStop");
Conv.put(reel.reel_mc,"set",0,"_y",reel.reel_mc._y);
if(i < this.randomReels.length - 1)
{
Conv.put(empty,(random(10) + 5) * 100);
}
else
{
Conv.put(empty,"2");
}
i++;
}
};
C_SlotCLASS.prototype.startAnim = function()
{
var i = 0;
while(i < this.reelLength)
{
_root["reel_" + (i + 1) + "_mc"].blurAnim.show();
_root["reel_" + (i + 1) + "_mc"].blurAnim.gotoAndPlay(random(5) + 1);
i++;
}
this.soundSpinHolder = _root.createEmptyMovieClip("soundSpinHolder_mc",9899);
this.soundSpinHolder.newSound("spin",100,99);
};
C_SlotCLASS.prototype.setReelLines = function(num)
{
if(this.reelLines == num)
{
return undefined;
}
var isStarted = this.reelLines == undefined;
var lineUp = num > this.reelLines;
this.reelLines = num;
var a = [];
var i = 1;
while(i <= num)
{
a.push(i);
i++;
}
_root.reelsLines_mc.showLines(a);
_root.reelsLinesButtons_mc.setPos(this.reelLines);
this.display();
if(isStarted)
{
return undefined;
}
if(lineUp)
{
_root.newSound("lineUp");
}
else
{
_root.newSound("lineDown");
}
};
C_SlotCLASS.prototype.hideReelsLines = function()
{
_root.reelsLines_mc._visible = 0;
};
C_SlotCLASS.prototype.showReelsLines = function()
{
_root.reelsLines_mc._visible = 1;
};
C_SlotCLASS.prototype.blinkReels = function()
{
_root.reelsLines_mc.blink(this.prizeLines);
};
C_SlotCLASS.prototype.changeCoin = function(c)
{
if(this.locked)
{
return undefined;
}
var isStarted = this.coin == undefined;
if(this.coin == c)
{
return undefined;
}
this.coin = c;
this.display();
if(!isStarted)
{
_root.newSound("coinDrop",100);
}
};
C_SlotCLASS.prototype.setNumberCoins = function(c)
{
if(this.locked)
{
return undefined;
}
if(this.numberCoins == c)
{
return undefined;
}
var isStarted = this.numberCoins == undefined;
this.numberCoins = c;
if(_root.tablePrizes_mc.coins != this.numberCoins)
{
_root.tablePrizes_mc.setCoins(this.numberCoins);
}
if(_root.coinMenu_mc.coins != this.numberCoins)
{
_root.coinMenu_mc.setCoins(this.numberCoins);
}
this.display();
if(!isStarted)
{
_root.newSound("coinDrop",100);
}
};
C_SlotCLASS.prototype.updatePrizeTable = function()
{
_root.tablePrizes_mc.setTablePrizes(this.table);
};
_global.C_Slot = new C_SlotCLASS();
ASSetPropFlags(_global,"C_Slot,C_SlotCLASS",131);
if(SharedObject.getLocal("game_config").data.serverOn)
{
_root._visible = 0;
}
C_SlotCLASS.prototype.animLock = function()
{
};
C_SlotCLASS.prototype.animUnLock = function()
{
};
C_SlotCLASS.prototype.playWinAnim = function()
{
};
this.stop();
var sTemp = _url;
if(this._url.lastIndexOf("?") != -1)
{
sTemp = this._url.substr(0,this._url.lastIndexOf("?"));
}
sTemp = sTemp.substr(0,sTemp.lastIndexOf("/")) + "/";
loadMovieNum(sTemp + "index_cross.swf",1);